import request from '@/utils/request'

// 查询渠道授权列表
export function listGrant(query) {
  return request({
    url: '/admin/grant/list',
    method: 'get',
    params: query
  })
}

// 查询渠道授权详细
export function getGrant(configId) {
  return request({
    url: '/admin/grant/' + configId,
    method: 'get'
  })
}// 查询渠道授权详细
export function getGrantByPId(configId) {
  return request({
    url: '/admin/grant/byPId/' + configId,
    method: 'get'
  })
}

// 新增渠道授权
export function addGrant(data) {
  return request({
    url: '/admin/grant/save',
    method: 'post',
    data: data
  })
}

// 修改渠道授权
export function editGrant(data) {
  return request({
    url: '/admin/grant/update',
    method: 'put',
    data: data
  })
}

// 删除渠道授权
export function delGrant(configId) {
  return request({
    url: '/admin/grant/remove/' + configId,
    method: 'delete'
  })
}
